package com.wn32.main;

import java.util.ArrayList;
import java.util.List;

public class PersonDao {
    private static List<Person> list=new ArrayList<Person>();

    static{
        Person p1 = new Person(1, "张三", "男");
        Person p2 = new Person(2, "李四", "男");
        Person p3 = new Person(3, "王五", "女");
        list.add(p1);
        list.add(p2);
        list.add(p3);
    }
    public static List<Person> selectAll(){
        return list;
    }
    public static int getId(){
        return list.get(list.size()-1).getId()+1;
    }
    public static void add(Person p){
        list.add(p);
    }
}
